#! /bin/bash
. ./env.sh

update_registries() {

  for s in ${Host}; do
    sshpass -p $password ssh root@$s "rm -rf /etc/k8e/registries.yaml"
    echo $s '删除旧的配置文件'

    sshpass -p $password scp registries.yaml root@$s:/etc/k8e/
    echo $s '更新文件'

    sshpass -p $password ssh root@$s "systemctl daemon-reload && systemctl restart k8e.service"
    echo $s '启动服务'

  done
}
update_registries
